package com.css.fxfzaqbz.modules.data.controller;

import com.css.fxfzaqbz.base.response.RestResponse;
import com.css.fxfzaqbz.modules.data.queryParams.SeismicHazardAssessQueryParams;
import com.css.fxfzaqbz.modules.data.service.AssistOpinionAnalyseService;
import com.css.fxfzaqbz.modules.data.service.SeismicHazardAssessService;
import com.css.fxfzaqbz.util.PlatformPageUtils;
import com.css.fxfzaqbz.zcpt.sys.service.SysAreaService;
import com.css.fxfzaqbz.zcpt.sys.service.impl.SUserServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 *    辅助对策分析界面
 */
@RestController
@RequestMapping("/fxfzaqbz/data")
@Slf4j
public class AssistOpinionAnalyseController {

    @Resource
    AssistOpinionAnalyseService assistOpinionAnalyseService;

//    @Resource
//    private SysAreaService sysAreaService;
//    @Resource
//    private SUserServiceImpl sUserServiceImpl;


    /**
     * 查询
     *
     * @param request
     * @param queryParams
     * @return
     */
    @GetMapping("/getAllAssistOpinionAnalyse")
    public RestResponse getAllAssistOpinionAnalyse(HttpServletRequest request, SeismicHazardAssessQueryParams queryParams) {

        RestResponse restResponse = null;
        try {
            int curPage = Integer.valueOf(request.getParameter(PlatformPageUtils.CUR_PAGE));
            int pageSize = Integer.valueOf(request.getParameter(PlatformPageUtils.PAGE_SIZE));
            queryParams.setCurPage(curPage);
            queryParams.setPageSize(pageSize);
            restResponse = RestResponse.succeed(assistOpinionAnalyseService.getAllAssistOpinionAnalyse(queryParams));
        } catch (Exception e) {
            log.error("查询辅助对策分析数据失败", e);
            restResponse = RestResponse.fail("查询辅助对策分析数据失败");
        }
        return restResponse;
    }


}